package com.huike.controller.system;

import java.util.List;

import com.huike.domain.system.SysMenu;
import com.huike.domain.system.dto.LoginUser;
import com.huike.service.ISysMenuService;
import com.huike.utils.ServletUtils;
import com.huike.web.service.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import com.huike.common.annotation.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.huike.common.annotation.Log;
import com.huike.common.constant.Constants;
import com.huike.common.constant.UserConstants;
import com.huike.controller.core.BaseController;
import com.huike.domain.common.AjaxResult;
import com.huike.common.enums.BusinessType;
import com.huike.web.CurrentUserHolder;
import com.huike.utils.StringUtils;

/**
 * 菜单信息
 */
@Api(tags = "菜单管理")
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController {
    @Autowired
    private ISysMenuService menuService;

    @Autowired
    private TokenService tokenService;

    /**
     * 获取菜单列表
     */
    @ApiOperation("菜单管理-列表查询")
    @PreAuthorize("system:menu:list")
    //@GetMapping("/list")
    public AjaxResult list(SysMenu menu) {

        return null;
    }

    /**
     * 根据菜单编号获取详细信息
     */
    @ApiOperation("菜单管理-详情查询")
    @PreAuthorize("system:menu:query")
    //@GetMapping(value = "/{menuId}")
    public AjaxResult getInfo(@PathVariable Long menuId) {
        return null;
    }

    /**
     * 获取菜单下拉树列表
     */
    @ApiOperation("菜单管理-获取菜单下拉列表")
    //@GetMapping("/treeselect")
    public AjaxResult treeselect(SysMenu menu) {
        return null;
    }

    /**
     * 加载对应角色菜单列表树
     */
    @ApiOperation("菜单管理-根据角色查询菜单")
    //@GetMapping(value = "/roleMenuTreeselect/{roleId}")
    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
        return null;
    }

    /**
     * 新增菜单
     */
    @ApiOperation("菜单管理-新增")
    @PreAuthorize("system:menu:add")
    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
    //@PostMapping
    public AjaxResult add(@Validated @RequestBody SysMenu menu) {
        return null;
    }

    /**
     * 修改菜单
     */
    @ApiOperation("菜单管理-修改")
    @PreAuthorize("system:menu:edit")
    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
    //@PutMapping
    public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
        return null;
    }

    /**
     * 删除菜单
     */
    @ApiOperation("菜单管理-删除")
    @PreAuthorize("system:menu:remove")
    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
    //@DeleteMapping("/{menuId}")
    public AjaxResult remove(@PathVariable("menuId") Long menuId) {
        return null;
    }
}
